package com.youyun56.gps.android.commands;

import org.json.JSONObject;

import com.youyun56.gps.android.common.JSONKey;
import com.youyun56.gps.android.pojo.Im;

public class AddImExecutor extends Task {

    @Override
    public Object execute() throws Exception {
        JSONObject input = this.getCommand().getInput();
        if (!input.isNull(JSONKey.IM)) {
            JSONObject o = this.getCommand().getInput().getJSONObject(JSONKey.IM);
            Im im = new Im();
            im.setAddDay(o.getString("addDay"));
            im.setAttach(o.getString("attach"));
            im.setContext(o.getString("context"));
            im.setUserId(o.getLong("userId"));
            this.getCommand().setOutput(im);
        }
        return null;
    }
}
